package com.sendi.mobilework.util;

import android.content.Context;
import android.content.SharedPreferences;

/**
 * Created by Administrator on 2017/4/11.
 */

public class CacheUtils {

    /**
     * 输入缓存
     * @param context
     * @param key
     * @param value
     */
    public static void setCache(Context context,String key,String value){
        SharedPreferences sp=context.getSharedPreferences("mobile_work_cache",Context.MODE_PRIVATE);
        SharedPreferences.Editor editor=sp.edit();
        editor.putString(key,value);
        editor.commit();
    }

    /**
     * 获取缓存
     * @param context
     * @param key
     * @return
     */
    public static String getCache(Context context,String key){
        SharedPreferences sp=context.getSharedPreferences("mobile_work_cache",Context.MODE_PRIVATE);
        return sp.getString(key,"");
    }

}
